﻿Public Class RichTextEditExtCtrl
    Implements IDisposable


    ''' <summary>
    ''' Expose the HTMLText Properly 
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property HTMLText() As String
        Get
            Return Me.RichEditControl1.HtmlText
        End Get
        Set(ByVal value As String)
            Me.RichEditControl1.HtmlText = value
        End Set
    End Property
    Public Property RTFText() As String
        Get
            Return Me.RichEditControl1.RtfText
        End Get
        Set(ByVal value As String)
            Me.RichEditControl1.RtfText = value
        End Set
    End Property
    Private Sub RichTextEditExtCtrl_Load(sender As Object, e As EventArgs) Handles Me.Load
        LoadDictionaries()
        'RichEditControl1.SpellChecker = aspelll maching
        Me.RichEditControl1.Options.DocumentSaveOptions.CurrentFormat = DevExpress.XtraRichEdit.DocumentFormat.Rtf
    End Sub

    Private Sub LoadDictionaries()

        'Dim apath As String = IO.Path.GetDirectoryName(Application.ExecutablePath)
        'Dim openOfficeDictionary As New DevExpress.XtraSpellChecker.SpellCheckerOpenOfficeDictionary()
        'SharedDictionaryStorage1.Dictionaries.Clear()

        'openOfficeDictionary.DictionaryPath = apath & "\Dictionaries\en_US\en_US.dic"
        'openOfficeDictionary.GrammarPath = apath & "\Dictionaries\en_US\en_US.aff"
        'openOfficeDictionary.Culture = New Globalization.CultureInfo("en-US")
        'openOfficeDictionary.Load()
        'SharedDictionaryStorage1.Dictionaries.Add(openOfficeDictionary)


        'openOfficeDictionary.DictionaryPath = apath & "\Dictionaries\fr-CA\fr-toutesvariantes.dic"
        'openOfficeDictionary.GrammarPath = apath & "\Dictionaries\fr-CA\fr-toutesvariantes.aff"
        'openOfficeDictionary.Culture = New Globalization.CultureInfo("fr-CA")
        'openOfficeDictionary.Load()
        'SharedDictionaryStorage1.Dictionaries.Add(openOfficeDictionary)



        'SpellChecker1.Culture = New Globalization.CultureInfo(AppManager.ApplicationOption.Culture)

        'SpellChecker1.Culture = Globalization.CultureInfo.InvariantCulture
        'SpellChecker1.SpellCheckMode = DevExpress.XtraSpellChecker.SpellCheckMode.AsYouType
        'RichEditControl1.SpellChecker = SpellChecker1

    End Sub



    Private Sub SpellChecker1_AfterLoadDictionaries(sender As Object, e As EventArgs) Handles SpellChecker1.AfterLoadDictionaries

    End Sub
End Class
